<template>
  <!-- 添加或修改用户配置对话框 -->
  <el-dialog
    :title="title"
    :visible.sync="open"
    width="600px"
    :close-on-click-modal="false"
  >
    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
      <el-row>
        <el-col :span="24">
          <el-form-item :label="$locale('geWudevice.Equipment name')" prop="deviceName">
            <el-input disabled v-model="form.deviceName" style="width: 100%" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('jobList.Submission time')" prop="createTime">
            <el-input disabled v-model="form.createTime" style="width: 100%" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('teacher.add.Teacher Name')" prop="contacts">
            <el-input disabled v-model="form.contacts" style="width: 100%" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('geWudevice.Equipment number')" prop="deviceNum">
            <el-input disabled v-model="form.deviceNum" style="width: 100%" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('myClass.add.Contact Email')" prop="contactEmail">
            <el-input
              disabled
              v-model="form.contactEmail"
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('myClass.add.Contact Mobile')" prop="contactMobile">
            <el-input
              disabled
              v-model="form.contactMobile"
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('geWudevice.founder')" prop="createBy">
            <el-input disabled v-model="form.createBy" style="width: 100%" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$locale('maintenance.add.Repair content')" prop="upkeepContent">
            <el-input
              disabled
              v-model="form.upkeepContent"
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>

<script>
import { getInfoById } from '@/api/maintenance'
export default {
  name: 'maintenanceView',
  data() {
    return {
      // 遮罩层
      loading: true,
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      // 表单参数
      deviceTurnoverBoxVOS: [
        {
          deviceId: undefined,
          deviceTotal: undefined,
        },
      ],
      form: {},
      deviceList: [],
      listData: [],
      // 表单校验
      rules: {},
    }
  },
  created() {},
  methods: {
    // 表单重置
    reset() {
      this.resetForm('form')
    },
    /** 修改按钮操作 */
    show(row) {
      getInfoById(row.id)
        .then(({ data }) => {
          this.reset()
          this.form = data
          this.open = true
          this.title = '查看'
        })
        .catch((err) => {
          this.reset()
          this.form = JSON.parse(JSON.stringify(row))
          this.open = true
          this.title = '查看'
        })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
  },
}
</script>

<style lang="scss" scoped>
.el-rate {
  line-height: 2;
}
</style>
